<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>MC-GPU: MC-GPU_v1.3.h File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MC-GPU
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('MC-GPU__v1_83_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">MC-GPU_v1.3.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Header file containing the declarations for the MC-GPU code.  
<a href="#details">More...</a></p>

<p><a href="MC-GPU__v1_83_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structint2.html">int2</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structint3.html">int3</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfloat2.html">float2</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfloat3.html">float3</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdouble2.html">double2</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdouble3.html">double3</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structshort3.html">short3</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structulonglong2.html">ulonglong2</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsource__struct.html">source_struct</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure storing the data defining the source model (except for the energy spectrum).  <a href="structsource__struct.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsource__energy__struct.html">source_energy_struct</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure storing the source energy spectrum data to be sampled using the Walker aliasing algorithm.  <a href="structsource__energy__struct.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdetector__struct.html">detector_struct</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure storing the data defining the x-ray detector.  <a href="structdetector__struct.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structvoxel__struct.html">voxel_struct</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure defining a voxelized box with the back-lower corner at the coordinate origin.  <a href="structvoxel__struct.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlinear__interp.html">linear_interp</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure with the basic data required by the linear interpolation of the mean free paths: number of values and energy grid.  <a href="structlinear__interp.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcompton__struct.html">compton_struct</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure storing the data of the Compton interaction sampling model (equivalent to PENELOPE's common block /CGCO/).  <a href="structcompton__struct.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrayleigh__struct.html">rayleigh_struct</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure storing the data of the Rayleigh interaction sampling model (equivalent to PENELOPE's common block /CGRA/).  <a href="structrayleigh__struct.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a155f8b8dae8b676fc50d93a287c4e6df">MASTER_THREAD</a>&#160;&#160;&#160;if(0==myID)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">MPI macro: mark commands to be executed only by the master thread (myID==0).  <a href="#a155f8b8dae8b676fc50d93a287c4e6df"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a30b26edf408e1ff6034eb712ab7e173e">MAX_NUM_PROJECTIONS</a>&#160;&#160;&#160;720</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum number of projections allowed in the CT simulation (not limited by the constant memory because stored in global and shared memory):  <a href="#a30b26edf408e1ff6034eb712ab7e173e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a7aa308231ff3dcfd43ac19023e2e6e15">MAX_MATERIALS</a>&#160;&#160;&#160;15</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constants values for the Compton and Rayleigh models:  <a href="#a7aa308231ff3dcfd43ac19023e2e6e15"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a7fc9275784608be88cd40ac55f4de283">MAX_SHELLS</a>&#160;&#160;&#160;30</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a50e5fe2bed6d3ba8c550beb81e5e40e5">NP_RAYLEIGH</a>&#160;&#160;&#160;128</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a6ca3eda8d58b2d848a9d83c17c89a39c">MAX_ENERGYBINS_RAYLEIGH</a>&#160;&#160;&#160;25005</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a5185f8c2c84b828fb1c961f51527709a">MAX_ENERGY_BINS</a>&#160;&#160;&#160;256</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum number of energy bins in the input x-ray energy spectrum.  <a href="#a5185f8c2c84b828fb1c961f51527709a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a598a3330b3c21701223ee0ca14316eca">PI</a>&#160;&#160;&#160;3.14159265358979323846</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ac5a945020d3528355cda82d383676736">RAD2DEG</a>&#160;&#160;&#160;180.0/<a class="el" href="MC-GPU__v1_83_8h.html#a598a3330b3c21701223ee0ca14316eca">PI</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#af7e8592d0a634bd3642e9fd508ea8022">DEG2RAD</a>&#160;&#160;&#160;<a class="el" href="MC-GPU__v1_83_8h.html#a598a3330b3c21701223ee0ca14316eca">PI</a>/180.0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ac0c03cf5e803404f5dc2a42467395a3a">SCALE_eV</a>&#160;&#160;&#160;100.0f</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Value to scale the deposited energy in the pixels so that it can be stored as a long long integer instead of a double precision float.  <a href="#ac0c03cf5e803404f5dc2a42467395a3a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a4b98b60caf9dba36fca9fe41c3238404">EPS_SOURCE</a>&#160;&#160;&#160;0.000015f</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Offset value to make sure the particles are completely inside, or outside, the voxel bounding box.  <a href="#a4b98b60caf9dba36fca9fe41c3238404"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a0bc5a0759d92c51db359dddd471d6537">NEG_EPS_SOURCE</a>&#160;&#160;&#160;-<a class="el" href="MC-GPU__v1_83_8h.html#a4b98b60caf9dba36fca9fe41c3238404">EPS_SOURCE</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a12c2040f25d8e3a7b9e1c2024c618cb6">INF</a>&#160;&#160;&#160;500000.0f</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a67d3a72aafcb824f90fee0293c6a29f5">INF_minus1</a>&#160;&#160;&#160;499999.0f</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a98e3e165debaf418b6b285ff7538d3f3">NEG_INF</a>&#160;&#160;&#160;-500000.0f</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a1b7b63b09e6ac252980467701bd80cb7">max_value</a>(a, b)&#160;&#160;&#160;( ((a) &gt; (b)) ? (a) : (b) )</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Preprocessor macro to calculate maximum and minimum values:  <a href="#a1b7b63b09e6ac252980467701bd80cb7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a9fa6cc963655f85859604988fa68a9e2">min_value</a>(a, b)&#160;&#160;&#160;( ((a) &lt; (b)) ? (a) : (b) )</td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structint2.html">int2</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#abc9d1556799792cec3ef347f78ca112a">int2</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structint3.html">int3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a21d942232c0a6fe2b0e51f8f74d0f397">int3</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structfloat2.html">float2</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ac5ce49099e54cbb6e687df38a6f3fe96">float2</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structfloat3.html">float3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a79779bd606ab5af52c38e59729245f27">float3</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structdouble2.html">double2</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#afbcf6d6cd6d7417dcd52f4d48a50f2b1">double2</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structdouble3.html">double3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ae1bd8b9d018ba3a5d15e2f2146be2c9e">double3</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structshort3.html">short3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a41a7904c7ce29a6b26ea4c034ffc453b">short3</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structulonglong2.html">ulonglong2</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a197f1fccb1076eb0f1555b5571130b2b">ulonglong2</a></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ad3f14826495baa5f44c9f830572c4bcd">read_input</a> (int argc, char **argv, int myID, unsigned long long int *total_histories, int *gpu_id, int *seed_input, int *num_threads_per_block, int *histories_per_thread, struct <a class="el" href="structdetector__struct.html">detector_struct</a> *detector_data, unsigned long long int **image_ptr, int *image_bytes, struct <a class="el" href="structsource__struct.html">source_struct</a> *source_data, struct <a class="el" href="structsource__energy__struct.html">source_energy_struct</a> *source_energy_data, char *file_name_voxels, char file_name_materials[<a class="el" href="MC-GPU__v1_83_8h.html#a7aa308231ff3dcfd43ac19023e2e6e15">MAX_MATERIALS</a>][250], char *file_name_output, char *file_name_espc, int *num_projections, double *D_angle, double *angularROI_0, double *angularROI_1, double *initial_angle, <a class="el" href="structulonglong2.html">ulonglong2</a> **voxels_Edep_ptr, int *voxels_Edep_bytes, char *file_dose_output, short int *dose_ROI_x_min, short int *dose_ROI_x_max, short int *dose_ROI_y_min, short int *dose_ROI_y_max, short int *dose_ROI_z_min, short int *dose_ROI_z_max, double *SRotAxisD, double *vertical_translation_per_projection, int *flag_material_dose)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the input file given in the command line and return the significant data.  <a href="#ad3f14826495baa5f44c9f830572c4bcd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#aed61d205baa31cea69768bbd68c062c6">load_voxels</a> (int myID, char *file_name_voxels, float *density_max, struct <a class="el" href="structvoxel__struct.html">voxel_struct</a> *voxel_data, <a class="el" href="structfloat2.html">float2</a> **voxel_mat_dens_ptr, unsigned int *voxel_mat_dens_bytes, short int *dose_ROI_x_max, short int *dose_ROI_y_max, short int *dose_ROI_z_max)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the voxel data and allocate the material and density matrix.  <a href="#aed61d205baa31cea69768bbd68c062c6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ad23b50cb34b4aadcd24d9fec7e47ad24">load_material</a> (int myID, char file_name_materials[<a class="el" href="MC-GPU__v1_83_8h.html#a7aa308231ff3dcfd43ac19023e2e6e15">MAX_MATERIALS</a>][250], float *density_max, float *density_nominal, struct <a class="el" href="structlinear__interp.html">linear_interp</a> *mfp_table_data, <a class="el" href="structfloat2.html">float2</a> **mfp_Woodcock_table, int *mfp_Woodcock_table_bytes, <a class="el" href="structfloat3.html">float3</a> **mfp_table_a_ptr, <a class="el" href="structfloat3.html">float3</a> **mfp_table_b_ptr, int *mfp_table_bytes, struct <a class="el" href="structrayleigh__struct.html">rayleigh_struct</a> *rayleigh_table_ptr, struct <a class="el" href="structcompton__struct.html">compton_struct</a> *compton_table_ptr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the material input files and set the mean free paths and the "linear_interp" structures.  <a href="#ad23b50cb34b4aadcd24d9fec7e47ad24"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a96dba25b308814b25fbae71e27617f12">trim_name</a> (char *input_line, char *file_name)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract a file name from an input text line, trimming the initial blanks, trailing comment (#) and stopping at the first blank (the file name should not contain blanks).  <a href="#a96dba25b308814b25fbae71e27617f12"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#aea168bca1466813e03b649931a4f670f">fgets_trimmed</a> (char *trimmed_line, int num, FILE *file_ptr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a line of text and trim initial blancks and trailing comments (#).  <a href="#aea168bca1466813e03b649931a4f670f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#aa23f71412757b1d0e1d4c00e6b8a0c18">report_image</a> (char *file_name_output, struct <a class="el" href="structdetector__struct.html">detector_struct</a> *detector_data, struct <a class="el" href="structsource__struct.html">source_struct</a> *source_data, float mean_energy_spectrum, unsigned long long int *image, double time_elapsed, unsigned long long int total_histories, int current_projection, int num_projections, double D_angle, double initial_angle, int myID, int numprocs)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Report the tallied image in ASCII and binary form (32-bit floats).  <a href="#aa23f71412757b1d0e1d4c00e6b8a0c18"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a5f62e6c0430761bba20f1e546d396a27">set_CT_trajectory</a> (int myID, int num_projections, double D_angle, double angularROI_0, double angularROI_1, double SRotAxisD, struct <a class="el" href="structsource__struct.html">source_struct</a> *source_data, struct <a class="el" href="structdetector__struct.html">detector_struct</a> *detector_data, double vertical_translation_per_projection)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the CT trajectory: store in memory the source and detector rotations that are needed to calculate the multiple projections.  <a href="#a5f62e6c0430761bba20f1e546d396a27"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ac91d2c9046a60b6d7f225c573c4d4d98">report_voxels_dose</a> (char *file_dose_output, int num_projections, struct <a class="el" href="structvoxel__struct.html">voxel_struct</a> *voxel_data, <a class="el" href="structfloat2.html">float2</a> *voxel_mat_dens, <a class="el" href="structulonglong2.html">ulonglong2</a> *voxels_Edep, double time_elapsed_total, unsigned long long int total_histories, short int dose_ROI_x_min, short int dose_ROI_x_max, short int dose_ROI_y_min, short int dose_ROI_y_max, short int dose_ROI_z_min, short int dose_ROI_z_max, struct <a class="el" href="structsource__struct.html">source_struct</a> *source_data)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Report the total tallied 3D voxel dose deposition for all projections.  <a href="#ac91d2c9046a60b6d7f225c573c4d4d98"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ac1d6abb26890276f529eed6b7ceafe89">init_energy_spectrum</a> (char *file_name_espc, struct <a class="el" href="structsource__energy__struct.html">source_energy_struct</a> *source_energy_data, float *mean_energy_spectrum)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the energy spectrum file and initialize the Walker aliasing sampling.  <a href="#ac1d6abb26890276f529eed6b7ceafe89"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a6577c51b64b94b13c4e95df776275b5a">update_seed_PRNG</a> (int batch_number, unsigned long long int total_histories, int *seed)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the first seed of the pseudo-random number generator (PRNG) RANECU to a position far away from the previous history (leap frog technique).  <a href="#a6577c51b64b94b13c4e95df776275b5a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ac2eacae33c0451f6a23fdf1101c6ca11">IRND0</a> (float *W, float *F, short int *K, int N)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialisation of Walker's aliasing algorithm for random sampling from discrete probability distributions.  <a href="#ac2eacae33c0451f6a23fdf1101c6ca11"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#aa02ffc836f2b6f9de5386cadb11e30b7">report_materials_dose</a> (int num_projections, unsigned long long int total_histories, float *density_nominal, <a class="el" href="structulonglong2.html">ulonglong2</a> *materials_dose, double *mass_materials)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Report the tallied dose to each material number, accounting for different densities in different regions with the same material number.  <a href="#aa02ffc836f2b6f9de5386cadb11e30b7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a0b858ab906084d4426bfe5b522074e2c">seeki_walker</a> (float *cutoff, short int *alias, float randno, int n)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the interval (x(i),x(i+1)] containing the input value using Walker's aliasing method.  <a href="#a0b858ab906084d4426bfe5b522074e2c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ab1e2e311c809fe74d093498e53c9c954">track_particles</a> (int history_batch, int histories_per_thread, int num_p, int seed_input, unsigned long long int *image, <a class="el" href="structulonglong2.html">ulonglong2</a> *voxels_Edep, <a class="el" href="structfloat2.html">float2</a> *voxel_mat_dens, <a class="el" href="structfloat2.html">float2</a> *mfp_Woodcock_table, <a class="el" href="structfloat3.html">float3</a> *mfp_table_a, <a class="el" href="structfloat3.html">float3</a> *mfp_table_b, struct <a class="el" href="structrayleigh__struct.html">rayleigh_struct</a> *rayleigh_table, struct <a class="el" href="structcompton__struct.html">compton_struct</a> *compton_table, struct <a class="el" href="structdetector__struct.html">detector_struct</a> *detector_data_array, struct <a class="el" href="structsource__struct.html">source_struct</a> *source_data_array, <a class="el" href="structulonglong2.html">ulonglong2</a> *materials_dose)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the image array, ie, set all pixels to zero Essentially, this function has the same effect as the command: "cutilSafeCall(cudaMemcpy(image_device, image, image_bytes, cudaMemcpyHostToDevice))";.  <a href="#ab1e2e311c809fe74d093498e53c9c954"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a6807df36f6f2501a9f57ea4fce81b4f2">source</a> (<a class="el" href="structfloat3.html">float3</a> *position, <a class="el" href="structfloat3.html">float3</a> *direction, float *energy, <a class="el" href="structint2.html">int2</a> *seed, int *absvox, struct <a class="el" href="structsource__struct.html">source_struct</a> *source_data_SHARED, struct <a class="el" href="structdetector__struct.html">detector_struct</a> *detector_data_SHARED)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Source that creates primary x rays, according to the defined source model.  <a href="#a6807df36f6f2501a9f57ea4fce81b4f2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a047931bac84f3bce50dc13061371e765">move_to_bbox</a> (<a class="el" href="structfloat3.html">float3</a> *position, <a class="el" href="structfloat3.html">float3</a> *direction, <a class="el" href="structfloat3.html">float3</a> size_bbox, int *intersection_flag)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Functions that moves a particle inside the voxelized geometry bounding box.  <a href="#a047931bac84f3bce50dc13061371e765"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#aac14e3b20e073c6b169f2bd5c23da281">tally_image</a> (float *energy, <a class="el" href="structfloat3.html">float3</a> *position, <a class="el" href="structfloat3.html">float3</a> *direction, signed char *scatter_state, unsigned long long int *image, struct <a class="el" href="structsource__struct.html">source_struct</a> *source_data_SHARED, struct <a class="el" href="structdetector__struct.html">detector_struct</a> *detector_data_SHARED)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tally a radiographic projection image.  <a href="#aac14e3b20e073c6b169f2bd5c23da281"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ae7bd0b93b4d5eedb15822fa0ef622b48">init_PRNG</a> (int history_batch, int histories_per_thread, int seed_input, <a class="el" href="structint2.html">int2</a> *seed)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the pseudo-random number generator (PRNG) RANECU to a position far away from the previous history (leap frog technique).  <a href="#ae7bd0b93b4d5eedb15822fa0ef622b48"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ae9061f4314474bf4415200a5cb115397">abMODm</a> (int m, int a, int s)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate "(a1*a2) MOD m" with 32-bit integers and avoiding the possible overflow, using the Russian Peasant approach modulo m and the approximate factoring method, as described in: L'Ecuyer and Cote, ACM Trans.  <a href="#ae9061f4314474bf4415200a5cb115397"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a3b57f2faa5765ceba5d352641ca72a9f">ranecu</a> (<a class="el" href="structint2.html">int2</a> *seed)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pseudo-random number generator (PRNG) RANECU returning a float value (single precision version).  <a href="#a3b57f2faa5765ceba5d352641ca72a9f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a74c4894502584f8fb113e04b759a6c55">ranecu_double</a> (<a class="el" href="structint2.html">int2</a> *seed)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pseudo-random number generator (PRNG) RANECU returning a double value.  <a href="#a74c4894502584f8fb113e04b759a6c55"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a562dba755f1abdb20b1088d3121f4326">locate_voxel</a> (<a class="el" href="structfloat3.html">float3</a> *position, <a class="el" href="structshort3.html">short3</a> *voxel_coord)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Find the voxel that contains the current position.  <a href="#a562dba755f1abdb20b1088d3121f4326"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#acc5186c685730d287039c737445bbe43">rotate_double</a> (<a class="el" href="structfloat3.html">float3</a> *direction, double cos_theta, double phi)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Rotates a vector; the rotation is specified by giving the polar and azimuthal angles in the "self-frame", as determined by the vector to be rotated.  <a href="#acc5186c685730d287039c737445bbe43"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a5cafd4ebb3d155746b16ca7d231ecad1">GRAa</a> (float *energy, double *costh_Rayleigh, int *mat, float *pmax_current, <a class="el" href="structint2.html">int2</a> *seed, struct <a class="el" href="structrayleigh__struct.html">rayleigh_struct</a> *cgra)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sample a Rayleigh interaction using the sampling algorithm used in PENELOPE 2006.  <a href="#a5cafd4ebb3d155746b16ca7d231ecad1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a6f212862e7fba1553ec9495f05443b2c">GCOa</a> (float *energy, double *costh_Compton, int *mat, <a class="el" href="structint2.html">int2</a> *seed, struct <a class="el" href="structcompton__struct.html">compton_struct</a> *cgco_SHARED)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Random sampling of incoherent (Compton) scattering of photons, using the sampling algorithm from PENELOPE 2006: Relativistic impulse approximation with analytical one-electron Compton profiles.  <a href="#a6f212862e7fba1553ec9495f05443b2c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#abf1491ec13d6068d2753516a3721cfe2">tally_voxel_energy_deposition</a> (float *Edep, <a class="el" href="structshort3.html">short3</a> *voxel_coord, <a class="el" href="structulonglong2.html">ulonglong2</a> *dose)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tally the dose deposited in the voxels.  <a href="#abf1491ec13d6068d2753516a3721cfe2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a45a0719009ba55cca7af72f08f1090fb">tally_materials_dose</a> (float *Edep, int *material, <a class="el" href="structulonglong2.html">ulonglong2</a> *materials_dose)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tally the depose deposited inside each material.  <a href="#a45a0719009ba55cca7af72f08f1090fb"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">short int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a5d34c13b457e76dec83755628ead56fc">dose_ROI_x_min_CONST</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Global variable to be stored in the GPU constant memory defining the coordinates of the dose deposition region of interest.  <a href="#a5d34c13b457e76dec83755628ead56fc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">short int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a3c22177ce0c73c17ca8716d997678b61">dose_ROI_x_max_CONST</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">short int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ac161c8f74fd460e82e73917b3afff5fc">dose_ROI_y_min_CONST</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">short int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ab591ece7d8e024dcc8de71f59bc1cea5">dose_ROI_y_max_CONST</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">short int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a81db18966d58018976252f898cd905d9">dose_ROI_z_min_CONST</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">short int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#aea8fcb598ccc9c18ae601f9c7d936b9d">dose_ROI_z_max_CONST</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structvoxel__struct.html">voxel_struct</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a129396d7723d11e10c673c1171773cdc">voxel_data_CONST</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Global variable to be stored in the GPU constant memory defining the size of the voxel phantom.  <a href="#a129396d7723d11e10c673c1171773cdc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structsource__struct.html">source_struct</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a1b4da9b1f73994c4ed1aa7aafd036428">source_data_CONST</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Global variable to be stored in the GPU constant memory defining the x-ray source.  <a href="#a1b4da9b1f73994c4ed1aa7aafd036428"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structdetector__struct.html">detector_struct</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#aea632931ac52bff8d7c9e9cb4e63fd7a">detector_data_CONST</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Global variable to be stored in the GPU constant memory defining the x-ray detector.  <a href="#aea632931ac52bff8d7c9e9cb4e63fd7a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structlinear__interp.html">linear_interp</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#a8a3e410fb23d04f8a27d3d71c2381d24">mfp_table_data_CONST</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Global variable to be stored in the GPU constant memory defining the linear interpolation data.  <a href="#a8a3e410fb23d04f8a27d3d71c2381d24"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structsource__energy__struct.html">source_energy_struct</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8h.html#ad18b13e5db1d8c7c4acdd9af492d6914">source_energy_data_CONST</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Global variable to be stored in the GPU constant memory defining the source energy spectrum.  <a href="#ad18b13e5db1d8c7c4acdd9af492d6914"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Header file containing the declarations for the MC-GPU code. </p>
<p>This file declares all the host and device functions and structures, the library files to include in the compilation, various constants parameters of the simulation, pre-processor macro functions, etc. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Andreu Badal (<a href="mailto:Andreu.Badal-Soler@fda.hhs.gov">Andreu.Badal-Soler@fda.hhs.gov</a>) </dd></dl>
<dl class="date"><dt><b>Date:</b></dt><dd>2012/12/12 </dd></dl>

<p>Definition in file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>
</div><hr/><h2>Define Documentation</h2>
<a class="anchor" id="af7e8592d0a634bd3642e9fd508ea8022"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::DEG2RAD" ref="af7e8592d0a634bd3642e9fd508ea8022" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#af7e8592d0a634bd3642e9fd508ea8022">DEG2RAD</a>&#160;&#160;&#160;<a class="el" href="MC-GPU__v1_83_8h.html#a598a3330b3c21701223ee0ca14316eca">PI</a>/180.0</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00073">73</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">read_input()</a>.</p>

</div>
</div>
<a class="anchor" id="a4b98b60caf9dba36fca9fe41c3238404"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::EPS_SOURCE" ref="a4b98b60caf9dba36fca9fe41c3238404" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a4b98b60caf9dba36fca9fe41c3238404">EPS_SOURCE</a>&#160;&#160;&#160;0.000015f</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Offset value to make sure the particles are completely inside, or outside, the voxel bounding box. </p>
<p>For example, to start a particle track the source may have to translate a particle from the focal spot to the plane Y=0, but in reality the particle will be moved to Y=EPS_SOURCE to make sure it is unmistakenly located inside a voxel. If "EPS_SOURCE" is too small an artifact with weird concentric circular shadows may appear at the center of the simulated image. </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00085">85</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01033">locate_voxel()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00714">move_to_bbox()</a>.</p>

</div>
</div>
<a class="anchor" id="a12c2040f25d8e3a7b9e1c2024c618cb6"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::INF" ref="a12c2040f25d8e3a7b9e1c2024c618cb6" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a12c2040f25d8e3a7b9e1c2024c618cb6">INF</a>&#160;&#160;&#160;500000.0f</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00088">88</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

</div>
</div>
<a class="anchor" id="a67d3a72aafcb824f90fee0293c6a29f5"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::INF_minus1" ref="a67d3a72aafcb824f90fee0293c6a29f5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a67d3a72aafcb824f90fee0293c6a29f5">INF_minus1</a>&#160;&#160;&#160;499999.0f</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00089">89</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

</div>
</div>
<a class="anchor" id="a155f8b8dae8b676fc50d93a287c4e6df"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::MASTER_THREAD" ref="a155f8b8dae8b676fc50d93a287c4e6df" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a155f8b8dae8b676fc50d93a287c4e6df">MASTER_THREAD</a>&#160;&#160;&#160;if(0==myID)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>MPI macro: mark commands to be executed only by the master thread (myID==0). </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00056">56</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02110">load_material()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01929">load_voxels()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">read_input()</a>, and <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03194">set_CT_trajectory()</a>.</p>

</div>
</div>
<a class="anchor" id="a5185f8c2c84b828fb1c961f51527709a"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::MAX_ENERGY_BINS" ref="a5185f8c2c84b828fb1c961f51527709a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a5185f8c2c84b828fb1c961f51527709a">MAX_ENERGY_BINS</a>&#160;&#160;&#160;256</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Maximum number of energy bins in the input x-ray energy spectrum. </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00068">68</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03398">init_energy_spectrum()</a>.</p>

</div>
</div>
<a class="anchor" id="a6ca3eda8d58b2d848a9d83c17c89a39c"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::MAX_ENERGYBINS_RAYLEIGH" ref="a6ca3eda8d58b2d848a9d83c17c89a39c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a6ca3eda8d58b2d848a9d83c17c89a39c">MAX_ENERGYBINS_RAYLEIGH</a>&#160;&#160;&#160;25005</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00065">65</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02110">load_material()</a>.</p>

</div>
</div>
<a class="anchor" id="a7aa308231ff3dcfd43ac19023e2e6e15"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::MAX_MATERIALS" ref="a7aa308231ff3dcfd43ac19023e2e6e15" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a7aa308231ff3dcfd43ac19023e2e6e15">MAX_MATERIALS</a>&#160;&#160;&#160;15</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constants values for the Compton and Rayleigh models: </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">62</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01287">GCOa()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02110">load_material()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01929">load_voxels()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">read_input()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03128">report_materials_dose()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02890">report_voxels_dose()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="a30b26edf408e1ff6034eb712ab7e173e"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::MAX_NUM_PROJECTIONS" ref="a30b26edf408e1ff6034eb712ab7e173e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a30b26edf408e1ff6034eb712ab7e173e">MAX_NUM_PROJECTIONS</a>&#160;&#160;&#160;720</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Maximum number of projections allowed in the CT simulation (not limited by the constant memory because stored in global and shared memory): </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00059">59</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">read_input()</a>, and <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03194">set_CT_trajectory()</a>.</p>

</div>
</div>
<a class="anchor" id="a7fc9275784608be88cd40ac55f4de283"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::MAX_SHELLS" ref="a7fc9275784608be88cd40ac55f4de283" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a7fc9275784608be88cd40ac55f4de283">MAX_SHELLS</a>&#160;&#160;&#160;30</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00063">63</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01287">GCOa()</a>, and <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02110">load_material()</a>.</p>

</div>
</div>
<a class="anchor" id="a1b7b63b09e6ac252980467701bd80cb7"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::max_value" ref="a1b7b63b09e6ac252980467701bd80cb7" args="(a, b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a1b7b63b09e6ac252980467701bd80cb7">max_value</a></td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;( ((a) &gt; (b)) ? (a) : (b) )</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Preprocessor macro to calculate maximum and minimum values: </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00093">93</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01287">GCOa()</a>, and <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03398">init_energy_spectrum()</a>.</p>

</div>
</div>
<a class="anchor" id="a9fa6cc963655f85859604988fa68a9e2"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::min_value" ref="a9fa6cc963655f85859604988fa68a9e2" args="(a, b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a9fa6cc963655f85859604988fa68a9e2">min_value</a></td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;( ((a) &lt; (b)) ? (a) : (b) )</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00094">94</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01287">GCOa()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01181">GRAa()</a>, and <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01929">load_voxels()</a>.</p>

</div>
</div>
<a class="anchor" id="a0bc5a0759d92c51db359dddd471d6537"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::NEG_EPS_SOURCE" ref="a0bc5a0759d92c51db359dddd471d6537" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a0bc5a0759d92c51db359dddd471d6537">NEG_EPS_SOURCE</a>&#160;&#160;&#160;-<a class="el" href="MC-GPU__v1_83_8h.html#a4b98b60caf9dba36fca9fe41c3238404">EPS_SOURCE</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00087">87</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00714">move_to_bbox()</a>.</p>

</div>
</div>
<a class="anchor" id="a98e3e165debaf418b6b285ff7538d3f3"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::NEG_INF" ref="a98e3e165debaf418b6b285ff7538d3f3" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a98e3e165debaf418b6b285ff7538d3f3">NEG_INF</a>&#160;&#160;&#160;-500000.0f</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00090">90</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00714">move_to_bbox()</a>.</p>

</div>
</div>
<a class="anchor" id="a50e5fe2bed6d3ba8c550beb81e5e40e5"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::NP_RAYLEIGH" ref="a50e5fe2bed6d3ba8c550beb81e5e40e5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a50e5fe2bed6d3ba8c550beb81e5e40e5">NP_RAYLEIGH</a>&#160;&#160;&#160;128</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00064">64</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01181">GRAa()</a>, and <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02110">load_material()</a>.</p>

</div>
</div>
<a class="anchor" id="a598a3330b3c21701223ee0ca14316eca"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::PI" ref="a598a3330b3c21701223ee0ca14316eca" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#a598a3330b3c21701223ee0ca14316eca">PI</a>&#160;&#160;&#160;3.14159265358979323846</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00071">71</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">read_input()</a>, and <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03194">set_CT_trajectory()</a>.</p>

</div>
</div>
<a class="anchor" id="ac5a945020d3528355cda82d383676736"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::RAD2DEG" ref="ac5a945020d3528355cda82d383676736" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#ac5a945020d3528355cda82d383676736">RAD2DEG</a>&#160;&#160;&#160;180.0/<a class="el" href="MC-GPU__v1_83_8h.html#a598a3330b3c21701223ee0ca14316eca">PI</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00072">72</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">read_input()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02715">report_image()</a>, and <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03194">set_CT_trajectory()</a>.</p>

</div>
</div>
<a class="anchor" id="ac0c03cf5e803404f5dc2a42467395a3a"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::SCALE_eV" ref="ac0c03cf5e803404f5dc2a42467395a3a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="MC-GPU__v1_83_8h.html#ac0c03cf5e803404f5dc2a42467395a3a">SCALE_eV</a>&#160;&#160;&#160;100.0f</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Value to scale the deposited energy in the pixels so that it can be stored as a long long integer instead of a double precision float. </p>
<p>The integer values have to be used in order to use the atomicAdd function in CUDA. </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00079">79</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02715">report_image()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03128">report_materials_dose()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02890">report_voxels_dose()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00482">tally_image()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01547">tally_materials_dose()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00418">tally_voxel_energy_deposition()</a>.</p>

</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="afbcf6d6cd6d7417dcd52f4d48a50f2b1"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::double2" ref="afbcf6d6cd6d7417dcd52f4d48a50f2b1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structdouble2.html">double2</a> <a class="el" href="structdouble2.html">double2</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00134">134</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

</div>
</div>
<a class="anchor" id="ae1bd8b9d018ba3a5d15e2f2146be2c9e"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::double3" ref="ae1bd8b9d018ba3a5d15e2f2146be2c9e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structdouble3.html">double3</a> <a class="el" href="structdouble3.html">double3</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00135">135</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

</div>
</div>
<a class="anchor" id="ac5ce49099e54cbb6e687df38a6f3fe96"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::float2" ref="ac5ce49099e54cbb6e687df38a6f3fe96" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structfloat2.html">float2</a> <a class="el" href="structfloat2.html">float2</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00132">132</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

</div>
</div>
<a class="anchor" id="a79779bd606ab5af52c38e59729245f27"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::float3" ref="a79779bd606ab5af52c38e59729245f27" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structfloat3.html">float3</a> <a class="el" href="structfloat3.html">float3</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">133</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

</div>
</div>
<a class="anchor" id="abc9d1556799792cec3ef347f78ca112a"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::int2" ref="abc9d1556799792cec3ef347f78ca112a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structint2.html">int2</a> <a class="el" href="structint2.html">int2</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">130</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

</div>
</div>
<a class="anchor" id="a21d942232c0a6fe2b0e51f8f74d0f397"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::int3" ref="a21d942232c0a6fe2b0e51f8f74d0f397" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structint3.html">int3</a> <a class="el" href="structint3.html">int3</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">131</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

</div>
</div>
<a class="anchor" id="a41a7904c7ce29a6b26ea4c034ffc453b"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::short3" ref="a41a7904c7ce29a6b26ea4c034ffc453b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structshort3.html">short3</a> <a class="el" href="structshort3.html">short3</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00136">136</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

</div>
</div>
<a class="anchor" id="a197f1fccb1076eb0f1555b5571130b2b"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::ulonglong2" ref="a197f1fccb1076eb0f1555b5571130b2b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structulonglong2.html">ulonglong2</a> <a class="el" href="structulonglong2.html">ulonglong2</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00137">137</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ae9061f4314474bf4415200a5cb115397"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::abMODm" ref="ae9061f4314474bf4415200a5cb115397" args="(int m, int a, int s)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="MC-GPU__v1_83_8h.html#ae9061f4314474bf4415200a5cb115397">abMODm</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>m</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>s</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Calculate "(a1*a2) MOD m" with 32-bit integers and avoiding the possible overflow, using the Russian Peasant approach modulo m and the approximate factoring method, as described in: L'Ecuyer and Cote, ACM Trans. </p>
<p>Math. Soft. 17 (1991).</p>
<p>This function has been adapted from "seedsMLCG.f", see: Badal and Sempau, Computer Physics Communications 175 (2006)</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">m,a,s</td><td>MLCG parameters </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>(a1*a2) MOD m </dd></dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00919">919</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00841">init_PRNG()</a>, and <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03356">update_seed_PRNG()</a>.</p>

</div>
</div>
<a class="anchor" id="aea168bca1466813e03b649931a4f670f"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::fgets_trimmed" ref="aea168bca1466813e03b649931a4f670f" args="(char *trimmed_line, int num, FILE *file_ptr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* <a class="el" href="MC-GPU__v1_83_8h.html#aea168bca1466813e03b649931a4f670f">fgets_trimmed</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>trimmed_line</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>file_ptr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read a line of text and trim initial blancks and trailing comments (#). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>Characters to read </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">file_ptr</td><td>Pointer to the input file stream </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">trimmed_line</td><td>Trimmed line from input file, skipping empty lines and comments </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01868">1868</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03398">init_energy_spectrum()</a>, and <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">read_input()</a>.</p>

</div>
</div>
<a class="anchor" id="a6f212862e7fba1553ec9495f05443b2c"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::GCOa" ref="a6f212862e7fba1553ec9495f05443b2c" args="(float *energy, double *costh_Compton, int *mat, int2 *seed, struct compton_struct *cgco_SHARED)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#a6f212862e7fba1553ec9495f05443b2c">GCOa</a> </td>
          <td>(</td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>energy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>costh_Compton</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>mat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structint2.html">int2</a> *&#160;</td>
          <td class="paramname"><em>seed</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structcompton__struct.html">compton_struct</a> *&#160;</td>
          <td class="paramname"><em>cgco_SHARED</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Random sampling of incoherent (Compton) scattering of photons, using the sampling algorithm from PENELOPE 2006: Relativistic impulse approximation with analytical one-electron Compton profiles. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">energy</td><td>incident and final photon energy (eV) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">costh_Compton</td><td>cosine of the polar scattering angle </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">material</td><td>Current voxel material </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">seed</td><td>RANECU PRNG seed </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01287">1287</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00241">compton_struct::fco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00241">compton_struct::fj0</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00063">MAX_SHELLS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00093">max_value</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00094">min_value</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00244">compton_struct::noscco</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00965">ranecu()</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00241">compton_struct::uico</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="a5cafd4ebb3d155746b16ca7d231ecad1"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::GRAa" ref="a5cafd4ebb3d155746b16ca7d231ecad1" args="(float *energy, double *costh_Rayleigh, int *mat, float *pmax_current, int2 *seed, struct rayleigh_struct *cgra)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#a5cafd4ebb3d155746b16ca7d231ecad1">GRAa</a> </td>
          <td>(</td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>energy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>costh_Rayleigh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>mat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>pmax_current</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structint2.html">int2</a> *&#160;</td>
          <td class="paramname"><em>seed</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structrayleigh__struct.html">rayleigh_struct</a> *&#160;</td>
          <td class="paramname"><em>cgra</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sample a Rayleigh interaction using the sampling algorithm used in PENELOPE 2006. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">energy</td><td>Particle energy (not modified with Rayleigh) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">costh_Rayleigh</td><td>Cosine of the angular deflection </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">material</td><td>Current voxel material </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01181">1181</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::aco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::bco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00259">rayleigh_struct::itlco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00259">rayleigh_struct::ituco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00094">min_value</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00064">NP_RAYLEIGH</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::pco</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00995">ranecu_double()</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::xco</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="ac1d6abb26890276f529eed6b7ceafe89"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::init_energy_spectrum" ref="ac1d6abb26890276f529eed6b7ceafe89" args="(char *file_name_espc, struct source_energy_struct *source_energy_data, float *mean_energy_spectrum)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#ac1d6abb26890276f529eed6b7ceafe89">init_energy_spectrum</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name_espc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__energy__struct.html">source_energy_struct</a> *&#160;</td>
          <td class="paramname"><em>source_energy_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>mean_energy_spectrum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read the energy spectrum file and initialize the Walker aliasing sampling. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name_espc</td><td>File containing the energy spectrum (lower energy value in each bin and its emission probability). </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">source_energy_data</td><td>Energy spectrum and other source data. The Walker alias and cutoffs are initialized in this function. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">mean_energy_spectrum</td><td>Mean energy in the input x-ray energy spectrum. </td></tr>
  </table>
  </dd>
</dl>
<p>!Walker!! Calling PENELOPE's function to init the Walker method </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03398">3398</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00178">source_energy_struct::espc</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00180">source_energy_struct::espc_alias</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00178">source_energy_struct::espc_cutoff</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01868">fgets_trimmed()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03575">IRND0()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00068">MAX_ENERGY_BINS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00093">max_value</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00177">source_energy_struct::num_bins_espc</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="ae7bd0b93b4d5eedb15822fa0ef622b48"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::init_PRNG" ref="ae7bd0b93b4d5eedb15822fa0ef622b48" args="(int history_batch, int histories_per_thread, int seed_input, int2 *seed)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#ae7bd0b93b4d5eedb15822fa0ef622b48">init_PRNG</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>history_batch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>histories_per_thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>seed_input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structint2.html">int2</a> *&#160;</td>
          <td class="paramname"><em>seed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the pseudo-random number generator (PRNG) RANECU to a position far away from the previous history (leap frog technique). </p>
<p>Each calculated seed initiates a consecutive and disjoint sequence of pseudo-random numbers with length LEAP_DISTANCE, that can be used to in a parallel simulation (Sequence Splitting parallelization method). The basic equation behind the algorithm is: S(i+j) = (a**j * S(i)) MOD m = [(a**j MOD m)*S(i)] MOD m , which is described in: P L'Ecuyer, Commun. ACM 31 (1988) p.742</p>
<p>This function has been adapted from "seedsMLCG.f", see: A Badal and J Sempau, Computer Physics Communications 175 (2006) p. 440-450</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">history</td><td>Particle bach number. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">seed_input</td><td>Initial PRNG seed input (used to initiate both MLCGs in RANECU). </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">seed</td><td>Initial PRNG seeds for the present history. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00841">841</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00814">a1_RANECU</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00816">a2_RANECU</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00919">abMODm()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00812">LEAP_DISTANCE</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00815">m1_RANECU</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00817">m2_RANECU</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::x</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::y</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="ac2eacae33c0451f6a23fdf1101c6ca11"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::IRND0" ref="ac2eacae33c0451f6a23fdf1101c6ca11" args="(float *W, float *F, short int *K, int N)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#ac2eacae33c0451f6a23fdf1101c6ca11">IRND0</a> </td>
          <td>(</td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>W</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>K</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>N</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialisation of Walker's aliasing algorithm for random sampling from discrete probability distributions. </p>
<p>Input arguments: N ........ number of different values of the random variable. W(1:N) ... corresponding point probabilities (not necessarily normalised to unity). Output arguments: F(1:N) ... cutoff values. K(1:N) ... alias values.</p>
<p>This subroutine is part of the PENELOPE 2006 code developed by Francesc Salvat at the University of Barcelona. For more info: www.oecd-nea.org/science/pubs/2009/nea6416-penelope.pdf </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03575">3575</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03398">init_energy_spectrum()</a>.</p>

</div>
</div>
<a class="anchor" id="ad23b50cb34b4aadcd24d9fec7e47ad24"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::load_material" ref="ad23b50cb34b4aadcd24d9fec7e47ad24" args="(int myID, char file_name_materials[MAX_MATERIALS][250], float *density_max, float *density_nominal, struct linear_interp *mfp_table_data, float2 **mfp_Woodcock_table, int *mfp_Woodcock_table_bytes, float3 **mfp_table_a_ptr, float3 **mfp_table_b_ptr, int *mfp_table_bytes, struct rayleigh_struct *rayleigh_table_ptr, struct compton_struct *compton_table_ptr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#ad23b50cb34b4aadcd24d9fec7e47ad24">load_material</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>myID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>file_name_materials</em>[MAX_MATERIALS][250], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>density_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>density_nominal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structlinear__interp.html">linear_interp</a> *&#160;</td>
          <td class="paramname"><em>mfp_table_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat2.html">float2</a> **&#160;</td>
          <td class="paramname"><em>mfp_Woodcock_table_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>mfp_Woodcock_table_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> **&#160;</td>
          <td class="paramname"><em>mfp_table_a_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> **&#160;</td>
          <td class="paramname"><em>mfp_table_b_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>mfp_table_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structrayleigh__struct.html">rayleigh_struct</a> *&#160;</td>
          <td class="paramname"><em>rayleigh_table_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structcompton__struct.html">compton_struct</a> *&#160;</td>
          <td class="paramname"><em>compton_table_ptr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read the material input files and set the mean free paths and the "linear_interp" structures. </p>
<p>Find the material nominal density. Set the Woodcock trick data. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name_materials</td><td>Array with the names of the material files. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">density_max</td><td>maximum density in the geometry (needed to set Woodcock trick) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">density_nominal</td><td>Array with the nominal density of the materials read </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">mfp_table_data</td><td>Constant values for the linear interpolation </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">mfp_table_a_ptr</td><td>First element for the linear interpolation. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">mfp_table_b_ptr</td><td>Second element for the linear interpolation. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02110">2110</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::aco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::bco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00229">linear_interp::e0</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00241">compton_struct::fco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00241">compton_struct::fj0</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00229">linear_interp::ide</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00259">rayleigh_struct::itlco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00259">rayleigh_struct::ituco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00056">MASTER_THREAD</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00065">MAX_ENERGYBINS_RAYLEIGH</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00063">MAX_SHELLS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00244">compton_struct::noscco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00064">NP_RAYLEIGH</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00228">linear_interp::num_values</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::pco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::pmax</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00241">compton_struct::uico</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::xco</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="aed61d205baa31cea69768bbd68c062c6"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::load_voxels" ref="aed61d205baa31cea69768bbd68c062c6" args="(int myID, char *file_name_voxels, float *density_max, struct voxel_struct *voxel_data, float2 **voxel_mat_dens_ptr, unsigned int *voxel_mat_dens_bytes, short int *dose_ROI_x_max, short int *dose_ROI_y_max, short int *dose_ROI_z_max)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#aed61d205baa31cea69768bbd68c062c6">load_voxels</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>myID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name_voxels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>density_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structvoxel__struct.html">voxel_struct</a> *&#160;</td>
          <td class="paramname"><em>voxel_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat2.html">float2</a> **&#160;</td>
          <td class="paramname"><em>voxel_mat_dens_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>voxel_mat_dens_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_x_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_y_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_z_max</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read the voxel data and allocate the material and density matrix. </p>
<p>Also find and report the maximum density defined in the geometry. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name_voxels</td><td>Name of the voxelized geometry file. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">density_max</td><td>Array with the maximum density for each material in the voxels. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">voxel_data</td><td>Pointer to a structure containing the voxel number and size. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">voxel_mat_dens_ptr</td><td>Pointer to the vector with the voxel materials and densities. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dose_ROI_x/y/z_max</td><td>Size of the dose ROI: can not be larger than the total number of voxels in the geometry. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01929">1929</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00216">voxel_struct::inv_voxel_size</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00056">MASTER_THREAD</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00094">min_value</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00215">voxel_struct::num_voxels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00216">voxel_struct::size_bbox</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::z</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a562dba755f1abdb20b1088d3121f4326"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::locate_voxel" ref="a562dba755f1abdb20b1088d3121f4326" args="(float3 *position, short3 *voxel_coord)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="MC-GPU__v1_83_8h.html#a562dba755f1abdb20b1088d3121f4326">locate_voxel</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> *&#160;</td>
          <td class="paramname"><em>position</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structshort3.html">short3</a> *&#160;</td>
          <td class="paramname"><em>voxel_coord</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Find the voxel that contains the current position. </p>
<p>Report the voxel absolute index and the x,y,z indices. The structure containing the voxel number and size is read from CONSTANT memory.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">position</td><td>Particle position </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">voxel_coord</td><td>Pointer to three integer values (short3*) that will store the x,y and z voxel indices. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns "absvox", the voxel number where the particle is located (negative if position outside the voxel bbox). </dd></dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01033">1033</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00085">EPS_SOURCE</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00216">voxel_struct::inv_voxel_size</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00215">voxel_struct::num_voxels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00216">voxel_struct::size_bbox</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00317">voxel_data_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00136">short3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00136">short3::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00136">short3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="a047931bac84f3bce50dc13061371e765"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::move_to_bbox" ref="a047931bac84f3bce50dc13061371e765" args="(float3 *position, float3 *direction, float3 size_bbox, int *intersection_flag)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#a047931bac84f3bce50dc13061371e765">move_to_bbox</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> *&#160;</td>
          <td class="paramname"><em>position</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> *&#160;</td>
          <td class="paramname"><em>direction</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a>&#160;</td>
          <td class="paramname"><em>size_bbox</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>intersection_flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Functions that moves a particle inside the voxelized geometry bounding box. </p>
<p>An EPSILON distance is added to make sure the particles will be clearly inside the bbox, not exactly on the surface.</p>
<p>This algorithm makes the following assumtions:</p>
<ul>
<li>The back lower vertex of the voxel bounding box is always located at the origin: (x0,y0,z0)=(0,0,0).</li>
<li>The initial value of "position" corresponds to the focal spot location.</li>
<li>When a ray is not pointing towards the bbox plane that it should cross according to the sign of the direction, I assign a distance to the intersection =0 instead of the real negative distance. The wall that will be crossed to enter the bbox is always the furthest and therefore a 0 distance will never be used except in the case of a ray starting inside the bbox or outside the bbox and not pointing to any of the 3 planes. In this situation the ray will be transported a 0 distance, meaning that it will stay at the focal spot.</li>
</ul>
<p>(Interesting information on ray-box intersection: <a href="http://tog.acm.org/resources/GraphicsGems/gems/RayBox.c">http://tog.acm.org/resources/GraphicsGems/gems/RayBox.c</a>)</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">position</td><td>Particle position: initially set to the focal spot, returned transported inside the voxel bbox. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">direction</td><td>Sampled particle direction (cosine vectors). </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">intersection_flag</td><td>Set to &lt;0 if particle outside bbox and will not cross the voxels, not changed otherwise. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">size_bbox</td><td>Size of the bounding box. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00714">714</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00085">EPS_SOURCE</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00087">NEG_EPS_SOURCE</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00090">NEG_INF</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00626">source()</a>.</p>

</div>
</div>
<a class="anchor" id="a3b57f2faa5765ceba5d352641ca72a9f"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::ranecu" ref="a3b57f2faa5765ceba5d352641ca72a9f" args="(int2 *seed)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float <a class="el" href="MC-GPU__v1_83_8h.html#a3b57f2faa5765ceba5d352641ca72a9f">ranecu</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structint2.html">int2</a> *&#160;</td>
          <td class="paramname"><em>seed</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Pseudo-random number generator (PRNG) RANECU returning a float value (single precision version). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">seed</td><td>PRNG seed (seed kept in the calling function and updated here). </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>PRN double value in the open interval (0,1) </dd></dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00965">965</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::x</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::y</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01287">GCOa()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00626">source()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="a74c4894502584f8fb113e04b759a6c55"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::ranecu_double" ref="a74c4894502584f8fb113e04b759a6c55" args="(int2 *seed)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="MC-GPU__v1_83_8h.html#a74c4894502584f8fb113e04b759a6c55">ranecu_double</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structint2.html">int2</a> *&#160;</td>
          <td class="paramname"><em>seed</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Pseudo-random number generator (PRNG) RANECU returning a double value. </p>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00995">995</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::x</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::y</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01181">GRAa()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="ad3f14826495baa5f44c9f830572c4bcd"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::read_input" ref="ad3f14826495baa5f44c9f830572c4bcd" args="(int argc, char **argv, int myID, unsigned long long int *total_histories, int *gpu_id, int *seed_input, int *num_threads_per_block, int *histories_per_thread, struct detector_struct *detector_data, unsigned long long int **image_ptr, int *image_bytes, struct source_struct *source_data, struct source_energy_struct *source_energy_data, char *file_name_voxels, char file_name_materials[MAX_MATERIALS][250], char *file_name_output, char *file_name_espc, int *num_projections, double *D_angle, double *angularROI_0, double *angularROI_1, double *initial_angle, ulonglong2 **voxels_Edep_ptr, int *voxels_Edep_bytes, char *file_dose_output, short int *dose_ROI_x_min, short int *dose_ROI_x_max, short int *dose_ROI_y_min, short int *dose_ROI_y_max, short int *dose_ROI_z_min, short int *dose_ROI_z_max, double *SRotAxisD, double *vertical_translation_per_projection, int *flag_material_dose)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#ad3f14826495baa5f44c9f830572c4bcd">read_input</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>argv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>myID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int *&#160;</td>
          <td class="paramname"><em>total_histories</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>seed_input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>gpu_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>num_threads_per_block</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>histories_per_thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structdetector__struct.html">detector_struct</a> *&#160;</td>
          <td class="paramname"><em>detector_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int **&#160;</td>
          <td class="paramname"><em>image_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>image_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__struct.html">source_struct</a> *&#160;</td>
          <td class="paramname"><em>source_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__energy__struct.html">source_energy_struct</a> *&#160;</td>
          <td class="paramname"><em>source_energy_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name_voxels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>file_name_materials</em>[MAX_MATERIALS][250], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name_output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name_espc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>num_projections</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>D_angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>angularROI_0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>angularROI_1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>initial_angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structulonglong2.html">ulonglong2</a> **&#160;</td>
          <td class="paramname"><em>voxels_Edep_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>voxels_Edep_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_dose_output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_x_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_x_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_y_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_y_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_z_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_z_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>SRotAxisD</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>vertical_translation_per_projection</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>flag_material_dose</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read the input file given in the command line and return the significant data. </p>
<p>Example input file:</p>
<p>1000000 [Total number of histories to simulate] geometry.vox [Voxelized geometry file name] material.mat [Material data file name]</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">argc</td><td>Command line parameters </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">argv</td><td>Command line parameters: name of input file </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">total_histories</td><td>Total number of particles to simulate </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">seed_input</td><td>Input random number generator seed </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">num_threads_per_block</td><td>Number of CUDA threads for each GPU block </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">detector_data</td><td></td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">image</td><td></td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">source_data</td><td></td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">file_name_voxels</td><td></td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">file_name_materials</td><td></td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">file_name_output</td><td></td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">1242</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00195">detector_struct::center</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00195">detector_struct::corner_min_rotated_to_Y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00161">source_struct::cos_theta_low</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00073">DEG2RAD</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::direction</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01868">fgets_trimmed()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::height_Z</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_X</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_Z</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00056">MASTER_THREAD</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00059">MAX_NUM_PROJECTIONS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00202">detector_struct::num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00071">PI</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::position</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00072">RAD2DEG</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::rot_inv</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00203">detector_struct::rotation_flag</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00194">detector_struct::sdd</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00203">detector_struct::total_num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01840">trim_name()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::width_X</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="aa23f71412757b1d0e1d4c00e6b8a0c18"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::report_image" ref="aa23f71412757b1d0e1d4c00e6b8a0c18" args="(char *file_name_output, struct detector_struct *detector_data, struct source_struct *source_data, float mean_energy_spectrum, unsigned long long int *image, double time_elapsed, unsigned long long int total_histories, int current_projection, int num_projections, double D_angle, double initial_angle, int myID, int numprocs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="MC-GPU__v1_83_8h.html#aa23f71412757b1d0e1d4c00e6b8a0c18">report_image</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name_output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structdetector__struct.html">detector_struct</a> *&#160;</td>
          <td class="paramname"><em>detector_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__struct.html">source_struct</a> *&#160;</td>
          <td class="paramname"><em>source_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>mean_energy_spectrum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int *&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>time_elapsed</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int&#160;</td>
          <td class="paramname"><em>total_histories</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>current_projection</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_projections</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>D_angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>initial_angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>myID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numprocs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Report the tallied image in ASCII and binary form (32-bit floats). </p>
<p>Separate images for primary and scatter radiation are generated.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name_output</td><td>File where tallied image is reported </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">detector_data</td><td>Detector description read from the input file (pointer to <a class="el" href="structdetector__struct.html" title="Structure storing the data defining the x-ray detector.">detector_struct</a>) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">image</td><td>Tallied image (in meV per pixel) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">time_elapsed</td><td>Time elapsed during the main loop execution (in seconds) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">total_histories</td><td>Total number of x-rays simulated </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02715">2715</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::direction</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_X</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_Z</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00202">detector_struct::num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::position</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00072">RAD2DEG</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00079">SCALE_eV</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="aa02ffc836f2b6f9de5386cadb11e30b7"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::report_materials_dose" ref="aa02ffc836f2b6f9de5386cadb11e30b7" args="(int num_projections, unsigned long long int total_histories, float *density_nominal, ulonglong2 *materials_dose, double *mass_materials)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="MC-GPU__v1_83_8h.html#aa02ffc836f2b6f9de5386cadb11e30b7">report_materials_dose</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_projections</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int&#160;</td>
          <td class="paramname"><em>total_histories</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>density_nominal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structulonglong2.html">ulonglong2</a> *&#160;</td>
          <td class="paramname"><em>materials_dose</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>mass_materials</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Report the tallied dose to each material number, accounting for different densities in different regions with the same material number. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">num_projections</td><td>Number of projections simulated </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">total_histories</td><td>Total number of x-rays simulated per projection </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">density_nominal</td><td>Array with the nominal densities of materials given in the input file; -1 for materials not defined. Used to report only defined materials. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">materials_dose</td><td>Tallied dose and dose^2 arrays </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03128">3128</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00079">SCALE_eV</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="ac91d2c9046a60b6d7f225c573c4d4d98"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::report_voxels_dose" ref="ac91d2c9046a60b6d7f225c573c4d4d98" args="(char *file_dose_output, int num_projections, struct voxel_struct *voxel_data, float2 *voxel_mat_dens, ulonglong2 *voxels_Edep, double time_elapsed_total, unsigned long long int total_histories, short int dose_ROI_x_min, short int dose_ROI_x_max, short int dose_ROI_y_min, short int dose_ROI_y_max, short int dose_ROI_z_min, short int dose_ROI_z_max, struct source_struct *source_data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="MC-GPU__v1_83_8h.html#ac91d2c9046a60b6d7f225c573c4d4d98">report_voxels_dose</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_dose_output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_projections</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structvoxel__struct.html">voxel_struct</a> *&#160;</td>
          <td class="paramname"><em>voxel_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat2.html">float2</a> *&#160;</td>
          <td class="paramname"><em>voxel_mat_dens</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structulonglong2.html">ulonglong2</a> *&#160;</td>
          <td class="paramname"><em>voxels_Edep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>time_total_MC_init_report</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int&#160;</td>
          <td class="paramname"><em>total_histories</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int&#160;</td>
          <td class="paramname"><em>dose_ROI_x_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int&#160;</td>
          <td class="paramname"><em>dose_ROI_x_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int&#160;</td>
          <td class="paramname"><em>dose_ROI_y_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int&#160;</td>
          <td class="paramname"><em>dose_ROI_y_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int&#160;</td>
          <td class="paramname"><em>dose_ROI_z_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int&#160;</td>
          <td class="paramname"><em>dose_ROI_z_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__struct.html">source_struct</a> *&#160;</td>
          <td class="paramname"><em>source_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Report the total tallied 3D voxel dose deposition for all projections. </p>
<p>The voxel doses in the input ROI and their respective uncertainties are reported in binary form (32-bit floats) in two separate .raw files. The dose in a single plane at the level of the focal spot is also reported in ASCII format for simple visualization with GNUPLOT. The total dose deposited in each different material is reported to the standard output. The material dose is calculated adding the energy deposited in the individual voxels within the dose ROI, and dividing by the total mass of the material in the ROI.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_dose_output</td><td>File where tallied image is reported </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">detector_data</td><td>Detector description read from the input file (pointer to <a class="el" href="structdetector__struct.html" title="Structure storing the data defining the x-ray detector.">detector_struct</a>) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">image</td><td>Tallied image (in meV per pixel) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">time_elapsed</td><td>Time elapsed during the main loop execution (in seconds) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">total_histories</td><td>Total number of x-rays simulated </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">source_data</td><td>Data required to compute the voxel plane to report in ASCII format: Z at the level of the source, 1st projection </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02890">2890</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00216">voxel_struct::inv_voxel_size</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00215">voxel_struct::num_voxels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00079">SCALE_eV</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00137">ulonglong2::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00132">float2::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="acc5186c685730d287039c737445bbe43"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::rotate_double" ref="acc5186c685730d287039c737445bbe43" args="(float3 *direction, double cos_theta, double phi)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#acc5186c685730d287039c737445bbe43">rotate_double</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> *&#160;</td>
          <td class="paramname"><em>direction</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>costh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>phi</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Rotates a vector; the rotation is specified by giving the polar and azimuthal angles in the "self-frame", as determined by the vector to be rotated. </p>
<p>This function is a literal translation from Fortran to C of PENELOPE (v. 2006) subroutine "DIRECT".</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">(u,v,w)</td><td>input vector (=d) in the lab. frame; returns the rotated vector components in the lab. frame </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">costh</td><td>cos(theta), angle between d before and after turn </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">phi</td><td>azimuthal angle (rad) turned by d in its self-frame </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01103">1103</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="a0b858ab906084d4426bfe5b522074e2c"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::seeki_walker" ref="a0b858ab906084d4426bfe5b522074e2c" args="(float *cutoff, short int *alias, float randno, int n)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="MC-GPU__v1_83_8h.html#a0b858ab906084d4426bfe5b522074e2c">seeki_walker</a> </td>
          <td>(</td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>cutoff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>alias</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>randno</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Finds the interval (x(i),x(i+1)] containing the input value using Walker's aliasing method. </p>
<p>Input: cutoff(1..n) -&gt; interval cutoff values for the Walker method cutoff(1..n) -&gt; alias for the upper part of each interval randno -&gt; point to be located n -&gt; no. of data points Output: index i of the semiopen interval where randno lies Comments: -&gt; The cutoff and alias values have to be previously initialised calling the penelope subroutine IRND0.</p>
<p>Algorithm implementation based on the PENELOPE code developed by Francesc Salvat at the University of Barcelona. For more info: www.oecd-nea.org/science/pubs/2009/nea6416-penelope.pdf </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03526">3526</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

</div>
</div>
<a class="anchor" id="a5f62e6c0430761bba20f1e546d396a27"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::set_CT_trajectory" ref="a5f62e6c0430761bba20f1e546d396a27" args="(int myID, int num_projections, double D_angle, double angularROI_0, double angularROI_1, double SRotAxisD, struct source_struct *source_data, struct detector_struct *detector_data, double vertical_translation_per_projection)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#a5f62e6c0430761bba20f1e546d396a27">set_CT_trajectory</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>myID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_projections</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>D_angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>angularROI_0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>angularROI_1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>SRotAxisD</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__struct.html">source_struct</a> *&#160;</td>
          <td class="paramname"><em>source_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structdetector__struct.html">detector_struct</a> *&#160;</td>
          <td class="paramname"><em>detector_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>vertical_translation_per_projection</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the CT trajectory: store in memory the source and detector rotations that are needed to calculate the multiple projections. </p>
<p>The first projection (0) was previously initialized in function "read_input".</p>
<p>ASSUMPTIONS: the CT scan plane must be perpendicular to the Z axis, ie, the initial direction of the particles must have w=0! </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03194">3194</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00195">detector_struct::center</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00195">detector_struct::corner_min_rotated_to_Y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::direction</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::height_Z</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_X</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_Z</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00056">MASTER_THREAD</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00059">MAX_NUM_PROJECTIONS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00202">detector_struct::num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00071">PI</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::position</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00072">RAD2DEG</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::rot_inv</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00203">detector_struct::rotation_flag</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00194">detector_struct::sdd</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00203">detector_struct::total_num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::width_X</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a6807df36f6f2501a9f57ea4fce81b4f2"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::source" ref="a6807df36f6f2501a9f57ea4fce81b4f2" args="(float3 *position, float3 *direction, float *energy, int2 *seed, int *absvox, struct source_struct *source_data_SHARED, struct detector_struct *detector_data_SHARED)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#a6807df36f6f2501a9f57ea4fce81b4f2">source</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> *&#160;</td>
          <td class="paramname"><em>position</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> *&#160;</td>
          <td class="paramname"><em>direction</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>energy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structint2.html">int2</a> *&#160;</td>
          <td class="paramname"><em>seed</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>absvox</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__struct.html">source_struct</a> *&#160;</td>
          <td class="paramname"><em>source_data_SHARED</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structdetector__struct.html">detector_struct</a> *&#160;</td>
          <td class="paramname"><em>detector_data_SHARED</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Source that creates primary x rays, according to the defined source model. </p>
<p>The particles are automatically moved to the surface of the voxel bounding box, to start the tracking inside a real material. If the sampled particle do not enter the voxels, it is init in the focal spot and the main program will check if it arrives at the detector or not.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">source_data</td><td>Structure describing the source. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">source_energy_data_CONST</td><td>Global variable in constant memory space describing the source energy spectrum. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">position</td><td>Initial particle position (particle transported inside the voxel bbox). </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">direction</td><td>Sampled particle direction (cosine vectors). </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">energy</td><td>Sampled energy of the new x ray. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">seed</td><td>Current seed of the random number generator, requiered to sample the movement direction. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">absvox</td><td>Set to &lt;0 if primary particle will not cross the voxels, not changed otherwise (&gt;0). </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00626">626</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00161">source_struct::cos_theta_low</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00161">source_struct::D_cos_theta</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00161">source_struct::D_phi</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00178">source_energy_struct::espc</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00180">source_energy_struct::espc_alias</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00178">source_energy_struct::espc_cutoff</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00161">source_struct::max_height_at_y1cm</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00714">move_to_bbox()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00177">source_energy_struct::num_bins_espc</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00161">source_struct::phi_low</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::position</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00965">ranecu()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00161">source_struct::rot_fan</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00203">detector_struct::rotation_flag</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00216">voxel_struct::size_bbox</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00341">source_energy_data_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00317">voxel_data_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="aac14e3b20e073c6b169f2bd5c23da281"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::tally_image" ref="aac14e3b20e073c6b169f2bd5c23da281" args="(float *energy, float3 *position, float3 *direction, signed char *scatter_state, unsigned long long int *image, struct source_struct *source_data_SHARED, struct detector_struct *detector_data_SHARED)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#aac14e3b20e073c6b169f2bd5c23da281">tally_image</a> </td>
          <td>(</td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>energy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> *&#160;</td>
          <td class="paramname"><em>position</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> *&#160;</td>
          <td class="paramname"><em>direction</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">signed char *&#160;</td>
          <td class="paramname"><em>scatter_state</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int *&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__struct.html">source_struct</a> *&#160;</td>
          <td class="paramname"><em>source_data_SHARED</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structdetector__struct.html">detector_struct</a> *&#160;</td>
          <td class="paramname"><em>detector_data_SHARED</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tally a radiographic projection image. </p>
<p>This function is called whenever a particle escapes the voxelized volume. The code checks if the particle would arrive at the detector if it kept moving in a straight line after exiting the voxels (assuming vacuum enclosure). An ideal image formation model is implemented: each pixel counts the total energy of the x rays that enter the pixel (100% detection efficiency for any energy). The image due to primaries and different kinds of scatter is tallied separately.</p>
<p>In the GPU, and atomicAdd() function is used to make sure that multiple threads do not update the same pixel at the same time, which would result in a lose of information. Since the atomicAdd function is only available for 'unsigned long long int' data, the float pixel values are scaled by a factor "SCALE_eV" defined in the header file (eg, #define SCALE_eV 10000.0f) and stored as unsigned long long integers in main memory.</p>
<p>WARNING! If the total tallied signal (for all particles) is larger than "1.8e19/SCALE_eV", there will be a bit overflow and the value will be reset to 0 giving bogus results.</p>
<p>WARNING! The detector plane should be located outside the voxels bounding box. However, since the particles are moved outside the bbox in the last step, they could cross the detector plane anyway. If the particles are less than 2.0 cm behind the detector, they are moved back and detected. Therefore the detector can be a few cm inside the bbox and still work. If the Woodcock mean free path is larger than the distance from the bbox to the detector, we may lose some particles behind the detector!</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">energy</td><td>X-ray energy </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">position</td><td>Particle position </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">direction</td><td>Particle direction (cosine vectors) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">scatter_state</td><td>Flag marking primaries, single Compton, single Rayleigh or multiple scattered radiation </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">image</td><td>Integer array containing the image, ie, the pixel values (in tenths of meV) </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00482">482</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00195">detector_struct::center</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00195">detector_struct::corner_min_rotated_to_Y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::direction</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_X</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_Z</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00202">detector_struct::num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::rot_inv</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00203">detector_struct::rotation_flag</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00079">SCALE_eV</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00203">detector_struct::total_num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="a45a0719009ba55cca7af72f08f1090fb"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::tally_materials_dose" ref="a45a0719009ba55cca7af72f08f1090fb" args="(float *Edep, int *material, ulonglong2 *materials_dose)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#a45a0719009ba55cca7af72f08f1090fb">tally_materials_dose</a> </td>
          <td>(</td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>Edep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>material</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structulonglong2.html">ulonglong2</a> *&#160;</td>
          <td class="paramname"><em>materials_dose</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tally the depose deposited inside each material. </p>
<p>This function is called whenever a particle suffers a Compton or photoelectric interaction. The energy released in each interaction is added and later in the report function the total deposited energy is divided by the total mass of the material in the voxelized object to get the dose. This naturally accounts for multiple densities for voxels with the same material (not all voxels have same mass). Electrons are not transported in MC-GPU and therefore we are approximating that the dose is equal to the KERMA (energy released by the photons alone). This approximation is acceptable when there is electronic equilibrium and when the range of the secondary electrons is shorter than the organ size.</p>
<p>The function uses atomic functions for a thread-safe access to the GPU memory. We can check if this tally was disabled in the input file checking if the array materials_dose was allocated in the GPU (disabled if pointer = NULL).</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">Edep</td><td>Energy deposited in the interaction </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">material</td><td>Current material id number </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">materials_dose</td><td><a class="el" href="structulonglong2.html">ulonglong2</a> array storing the mateials dose [in eV/g] and dose^2 (ie, uncertainty). </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01547">1547</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00079">SCALE_eV</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00137">ulonglong2::x</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00137">ulonglong2::y</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="abf1491ec13d6068d2753516a3721cfe2"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::tally_voxel_energy_deposition" ref="abf1491ec13d6068d2753516a3721cfe2" args="(float *Edep, short3 *voxel_coord, ulonglong2 *dose)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#abf1491ec13d6068d2753516a3721cfe2">tally_voxel_energy_deposition</a> </td>
          <td>(</td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>Edep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structshort3.html">short3</a> *&#160;</td>
          <td class="paramname"><em>voxel_coord</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structulonglong2.html">ulonglong2</a> *&#160;</td>
          <td class="paramname"><em>voxels_Edep</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tally the dose deposited in the voxels. </p>
<p>This function is called whenever a particle suffers a Compton or photoelectric interaction. It is not necessary to call this function if the dose tally was disabled in the input file (ie, dose_ROI_x_max_CONST &lt; 0). Electrons are not transported in MC-GPU and therefore we are approximating that the dose is equal to the KERMA (energy released by the photons alone). This approximation is acceptable when there is electronic equilibrium and when the range of the secondary electrons is shorter than the voxel size. Usually the doses will be acceptable for photon energies below 1 MeV. The dose estimates may not be accurate at the interface of low density volumes.</p>
<p>We need to use atomicAdd() in the GPU to prevent that multiple threads update the same voxel at the same time, which would result in a lose of information. This is very improbable when using a large number of voxels but gives troubles with a simple geometries with few voxels (in this case the atomicAdd will slow down the code because threads will update the voxel dose secuentially).</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">Edep</td><td>Energy deposited in the interaction </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">voxel_coord</td><td>Voxel coordinates, needed to check if particle located inside the input region of interest (ROI) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">voxels_Edep</td><td><a class="el" href="structulonglong2.html">ulonglong2</a> array containing the 3D voxel dose and dose^2 (ie, uncertainty) as unsigned integers scaled by SCALE_eV. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00418">418</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_x_max_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_x_min_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_y_max_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_y_min_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_z_max_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_z_min_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00079">SCALE_eV</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00136">short3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00137">ulonglong2::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00136">short3::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00137">ulonglong2::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00136">short3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="ab1e2e311c809fe74d093498e53c9c954"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::track_particles" ref="ab1e2e311c809fe74d093498e53c9c954" args="(int history_batch, int histories_per_thread, int num_p, int seed_input, unsigned long long int *image, ulonglong2 *voxels_Edep, float2 *voxel_mat_dens, float2 *mfp_Woodcock_table, float3 *mfp_table_a, float3 *mfp_table_b, struct rayleigh_struct *rayleigh_table, struct compton_struct *compton_table, struct detector_struct *detector_data_array, struct source_struct *source_data_array, ulonglong2 *materials_dose)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#ab1e2e311c809fe74d093498e53c9c954">track_particles</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>history_batch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>histories_per_thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>seed_input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int *&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structulonglong2.html">ulonglong2</a> *&#160;</td>
          <td class="paramname"><em>voxels_Edep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat2.html">float2</a> *&#160;</td>
          <td class="paramname"><em>voxel_mat_dens</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat2.html">float2</a> *&#160;</td>
          <td class="paramname"><em>mfp_Woodcock_table</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> *&#160;</td>
          <td class="paramname"><em>mfp_table_a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> *&#160;</td>
          <td class="paramname"><em>mfp_table_b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structrayleigh__struct.html">rayleigh_struct</a> *&#160;</td>
          <td class="paramname"><em>rayleigh_table</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structcompton__struct.html">compton_struct</a> *&#160;</td>
          <td class="paramname"><em>compton_table</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structdetector__struct.html">detector_struct</a> *&#160;</td>
          <td class="paramname"><em>detector_data_array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__struct.html">source_struct</a> *&#160;</td>
          <td class="paramname"><em>source_data_array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structulonglong2.html">ulonglong2</a> *&#160;</td>
          <td class="paramname"><em>materials_dose</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the image array, ie, set all pixels to zero Essentially, this function has the same effect as the command: "cutilSafeCall(cudaMemcpy(image_device, image, image_bytes, cudaMemcpyHostToDevice))";. </p>
<p>CUDA performs some initialization work the first time a GPU kernel is called. Therefore, calling a short kernel before the real particle tracking is performed may improve the accuracy of the timing measurements in the relevant kernel.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">image</td><td>Pointer to the image array. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">pixels_per_image</td><td>Number of pixels in the image (ie, elements in the array). Main function to simulate x-ray tracks inside a voxelized geometry. Secondary electrons are not simulated (in photoelectric and Compton events the energy is locally deposited).</td></tr>
  </table>
  </dd>
</dl>
<p>The following global variables, in the GPU __constant__ memory are used: voxel_data_CONST, source_energy_data_CONST, detector_data_CONST, mfp_table_data_CONST.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">history_batch</td><td>Particle batch number (only used in the CPU version when CUDA is disabled!, the GPU uses the built-in variable threadIdx) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">num_p</td><td>Projection number in the CT simulation. This variable defines a specific angle and the corresponding source and detector will be used. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">histories_per_thread</td><td>Number of histories to simulate for each call to this function (ie, for GPU thread). </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">seed_input</td><td>Random number generator seed (the same seed is used to initialize the two MLCGs of RANECU). </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">voxel_mat_dens</td><td>Pointer to the voxel densities and material vector (the voxelized geometry), stored in GPU glbal memory. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mfp_Woodcock_table</td><td>Two parameter table for the linear interpolation of the Woodcock mean free path (MFP) (stored in GPU global memory). </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mfp_table_a</td><td>First element for the linear interpolation of the interaction mean free paths (stored in GPU global memory). </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mfp_table_b</td><td>Second element for the linear interpolation of the interaction mean free paths (stored in GPU global memory). </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rayleigh_table</td><td>Pointer to the table with the data required by the Rayleigh interaction sampling, stored in GPU global memory. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">compton_table</td><td>Pointer to the table with the data required by the Compton interaction sampling, stored in GPU global memory. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">image</td><td>Pointer to the image vector in the GPU global memory. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">dose</td><td>Pointer to the array containing the 3D voxel dose (and its uncertainty) in the GPU global memory. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">135</a> of file <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html">MC-GPU_kernel_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_x_max_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00229">linear_interp::e0</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01287">GCOa()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01181">GRAa()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00229">linear_interp::ide</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00841">init_PRNG()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01033">locate_voxel()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00335">mfp_table_data_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::pmax</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00965">ranecu()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00995">ranecu_double()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01103">rotate_double()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00626">source()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00482">tally_image()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01547">tally_materials_dose()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00418">tally_voxel_energy_deposition()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00132">float2::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00132">float2::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a96dba25b308814b25fbae71e27617f12"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::trim_name" ref="a96dba25b308814b25fbae71e27617f12" args="(char *input_line, char *file_name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#a96dba25b308814b25fbae71e27617f12">trim_name</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>input_line</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Extract a file name from an input text line, trimming the initial blanks, trailing comment (#) and stopping at the first blank (the file name should not contain blanks). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">input_line</td><td>Input sentence with blanks and a trailing comment </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">file_name</td><td>Trimmed file name </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01840">1840</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">read_input()</a>.</p>

</div>
</div>
<a class="anchor" id="a6577c51b64b94b13c4e95df776275b5a"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::update_seed_PRNG" ref="a6577c51b64b94b13c4e95df776275b5a" args="(int batch_number, unsigned long long int total_histories, int *seed)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#a6577c51b64b94b13c4e95df776275b5a">update_seed_PRNG</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>batch_number</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int&#160;</td>
          <td class="paramname"><em>total_histories</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>seed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the first seed of the pseudo-random number generator (PRNG) RANECU to a position far away from the previous history (leap frog technique). </p>
<p>This function is equivalent to "init_PRNG" but only updates one of the seeds.</p>
<p>Note that if we use the same seed number to initialize the 2 MLCGs of the PRNG we can only warranty that the first MLCG will be uncorrelated for each value generated by "update_seed_PRNG". There is a tiny chance that the final PRNs will be correlated because the leap frog on the first MLCG will probably go over the repetition cycle of the MLCG, which is much smaller than the full RANECU. But any correlataion is extremely unlikely. Function "init_PRNG" doesn't have this issue.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">batch_number</td><td>Elements to skip (eg, MPI thread_number). </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">total_histories</td><td>Histories to skip. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">seed</td><td>Initial PRNG seeds; returns the updated seed. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03356">3356</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00814">a1_RANECU</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00919">abMODm()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00812">LEAP_DISTANCE</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00815">m1_RANECU</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="aea632931ac52bff8d7c9e9cb4e63fd7a"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::detector_data_CONST" ref="aea632931ac52bff8d7c9e9cb4e63fd7a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structdetector__struct.html">detector_struct</a> <a class="el" href="MC-GPU__v1_83_8h.html#aea632931ac52bff8d7c9e9cb4e63fd7a">detector_data_CONST</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Global variable to be stored in the GPU constant memory defining the x-ray detector. </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00329">329</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

</div>
</div>
<a class="anchor" id="a3c22177ce0c73c17ca8716d997678b61"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::dose_ROI_x_max_CONST" ref="a3c22177ce0c73c17ca8716d997678b61" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">short int <a class="el" href="MC-GPU__v1_83_8h.html#a3c22177ce0c73c17ca8716d997678b61">dose_ROI_x_max_CONST</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">311</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00418">tally_voxel_energy_deposition()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="a5d34c13b457e76dec83755628ead56fc"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::dose_ROI_x_min_CONST" ref="a5d34c13b457e76dec83755628ead56fc" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">short int <a class="el" href="MC-GPU__v1_83_8h.html#a5d34c13b457e76dec83755628ead56fc">dose_ROI_x_min_CONST</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Global variable to be stored in the GPU constant memory defining the coordinates of the dose deposition region of interest. </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">311</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00418">tally_voxel_energy_deposition()</a>.</p>

</div>
</div>
<a class="anchor" id="ab591ece7d8e024dcc8de71f59bc1cea5"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::dose_ROI_y_max_CONST" ref="ab591ece7d8e024dcc8de71f59bc1cea5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">short int <a class="el" href="MC-GPU__v1_83_8h.html#ab591ece7d8e024dcc8de71f59bc1cea5">dose_ROI_y_max_CONST</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">311</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00418">tally_voxel_energy_deposition()</a>.</p>

</div>
</div>
<a class="anchor" id="ac161c8f74fd460e82e73917b3afff5fc"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::dose_ROI_y_min_CONST" ref="ac161c8f74fd460e82e73917b3afff5fc" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">short int <a class="el" href="MC-GPU__v1_83_8h.html#ac161c8f74fd460e82e73917b3afff5fc">dose_ROI_y_min_CONST</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">311</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00418">tally_voxel_energy_deposition()</a>.</p>

</div>
</div>
<a class="anchor" id="aea8fcb598ccc9c18ae601f9c7d936b9d"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::dose_ROI_z_max_CONST" ref="aea8fcb598ccc9c18ae601f9c7d936b9d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">short int <a class="el" href="MC-GPU__v1_83_8h.html#aea8fcb598ccc9c18ae601f9c7d936b9d">dose_ROI_z_max_CONST</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">311</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00418">tally_voxel_energy_deposition()</a>.</p>

</div>
</div>
<a class="anchor" id="a81db18966d58018976252f898cd905d9"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::dose_ROI_z_min_CONST" ref="a81db18966d58018976252f898cd905d9" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">short int <a class="el" href="MC-GPU__v1_83_8h.html#a81db18966d58018976252f898cd905d9">dose_ROI_z_min_CONST</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">311</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00418">tally_voxel_energy_deposition()</a>.</p>

</div>
</div>
<a class="anchor" id="a8a3e410fb23d04f8a27d3d71c2381d24"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::mfp_table_data_CONST" ref="a8a3e410fb23d04f8a27d3d71c2381d24" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structlinear__interp.html">linear_interp</a> <a class="el" href="MC-GPU__v1_83_8h.html#a8a3e410fb23d04f8a27d3d71c2381d24">mfp_table_data_CONST</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Global variable to be stored in the GPU constant memory defining the linear interpolation data. </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00335">335</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>.</p>

</div>
</div>
<a class="anchor" id="a1b4da9b1f73994c4ed1aa7aafd036428"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::source_data_CONST" ref="a1b4da9b1f73994c4ed1aa7aafd036428" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structsource__struct.html">source_struct</a> <a class="el" href="MC-GPU__v1_83_8h.html#a1b4da9b1f73994c4ed1aa7aafd036428">source_data_CONST</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Global variable to be stored in the GPU constant memory defining the x-ray source. </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00323">323</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

</div>
</div>
<a class="anchor" id="ad18b13e5db1d8c7c4acdd9af492d6914"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::source_energy_data_CONST" ref="ad18b13e5db1d8c7c4acdd9af492d6914" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structsource__energy__struct.html">source_energy_struct</a> <a class="el" href="MC-GPU__v1_83_8h.html#ad18b13e5db1d8c7c4acdd9af492d6914">source_energy_data_CONST</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Global variable to be stored in the GPU constant memory defining the source energy spectrum. </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00341">341</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00626">source()</a>.</p>

</div>
</div>
<a class="anchor" id="a129396d7723d11e10c673c1171773cdc"></a><!-- doxytag: member="MC&#45;GPU_v1.3.h::voxel_data_CONST" ref="a129396d7723d11e10c673c1171773cdc" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structvoxel__struct.html">voxel_struct</a> <a class="el" href="MC-GPU__v1_83_8h.html#a129396d7723d11e10c673c1171773cdc">voxel_data_CONST</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Global variable to be stored in the GPU constant memory defining the size of the voxel phantom. </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8h_source.html#l00317">317</a> of file <a class="el" href="MC-GPU__v1_83_8h_source.html">MC-GPU_v1.3.h</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l01033">locate_voxel()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00626">source()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="MC-GPU__v1_83_8h.html">MC-GPU_v1.3.h</a>      </li>

    <li class="footer">Generated on Mon Dec 17 2012 13:26:39 for MC-GPU by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
